/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.uoc.tdp.pac3.domain;

import java.sql.Date;

/**
 * Classe POJO (Plain Old Java Object) que representa una fila de la taula tb_request
 * @author Gerard
 */
public class Request extends BaseDomain {
    
    private Integer userId;
    
    private Integer areaId;
    
    private String description;
    
    private RequestType requestType;

    public Request() {
    }

    public Request(Integer id, Date creationDate, Integer userId, Integer areaId, String description, RequestType requestType) {
        super(id, creationDate);
        this.userId = userId;
        this.areaId = areaId;
        this.description = description;
        this.requestType = requestType;
    }

    public Integer getAreaId() {
        return areaId;
    }

    public void setAreaId(Integer areaId) {
        this.areaId = areaId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
    
    public boolean isResolved(){
        boolean resolved = false;
        if(RequestType.SOLVED.equals(requestType)) {
           resolved = true;
        }
        return resolved;
    }

    public RequestType getRequestType() {
        return requestType;
    }

    public void setRequestType(RequestType requestType) {
        this.requestType = requestType;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return description +"("+super.toString() + ")";
    }
    
    
}
